<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp" %>
<%@page import="java.util.*,com.wits.qso.entity.Student"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%	

	List<Student> students=(List<Student>)request.getAttribute("students");
	List<Student> offlineList=(List<Student>)request.getAttribute("offlineList");
	
	int size=0;
	int offlineSize=0;
	int column=7;
	
	if(students!=null){
		size=students.size();
	}
	
	if(offlineList!=null){
		offlineSize=offlineList.size();
	}
	int rows=size%column==0?size/column:size/column+1;
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>签到</title> 
    <link href="${ctx}/static/ligerui/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <link href="${ctx}/static/ligerui/lib/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />

    <script src="${ctx}/static/ligerui/lib/jquery/jquery-1.5.2.min.js" type="text/javascript"></script>
    <script src="${ctx}/static/ligerui/lib/ligerUI/js/ligerui.min.js" type="text/javascript"></script>  
    <link href="${ctx}/static/ligerui/lib/css/common.css" rel="stylesheet" type="text/css" />  
	<link href="${ctx}/static/css/monitor/css/main.css" rel="stylesheet" type="text/css" />

    <script src="${ctx}/static/js/common.js" type="text/javascript"></script>
    <script src="${ctx}/static/ligerui/lib/js/LG.js" type="text/javascript"></script>
</head>
<body style="padding:10px; overflow:auto; text-align:center;background:#FFFFFF;"> 
<input type="hidden" id="groupId" value="${groupId}"/>

<table class="monitor-selection">
	<tr>
		<th style="width:75%"><img src="${ctx}/static/css/monitor/img/candidate_icon.png" style="vertical-align:middle;" />已到 学生 <%=size %>人</th>
		<th style="width:25%"><img src="${ctx}/static/css/monitor/img/checked_icon.png" style="vertical-align:middle;" /> 未到 学生<%=offlineSize %>人</th>
	</tr>
	<tr>
		<td>
			<table class="monitor-selection-inner">
			<%if(size>0) {
				int index=0;
			%>
				<%
					for( int i=0;i<rows;i++){
				%>
				<tr style="width:98%">
					<%
					Student stu=null;
						for(int j=0;j<column;j++){
							index=i*column+j;
							stu=null;
							if(index<size){
								stu=students.get(index);
							}
					%>
					<%
						if(stu!=null){
					%>
						<td id="noSelectedTd_<%=stu.getStuUserId()%>">
							<img id="noSelectedImg_<%=stu.getStuUserId()%>" src="${ctx}/static/css/instruction/img/man_on.png" style="vertical-align:middle;" onclick="select('<%=stu.getStuUserId()%>')"/>
							<span id="noSelectedSpan_<%=stu.getStuUserId()%>"><%=stu.getStuName()%></span>
						</td>
					<%}else{ %>
						<td>&nbsp;</td>
					<%} %>
					<%} %>
				</tr>
				<%} %>
			<%} %>									
			</table>
		</td>

		<td>
			<table class="monitor-selection-inner" id="rightSelectedTable">
			<%
			for(Student stu :offlineList){
				
			%>
				<tr id="rightSelectedTr_<%=stu.getStuUserId()%>">
					<td>
						<img onclick="deSelect('<%=stu.getStuUserId()%>')" src="${ctx}/static/css/instruction/img/man_off.png" style="vertical-align:middle;" />
						<span id="selectedSpan_<%=stu.getStuUserId()%>"><%=stu.getStuName()%></span>
					</td>
				</tr>
			

			<%} %>	
			</table>		
		</td>
		
	</tr>
</table>
</body>
</html>